# Contributor: Edd Salkield <edd@salkield.uk>
# Maintainer: Edd Salkield <edd@salkield.uk>
pkgname=levmar-dev
pkgver=2.6
pkgrel=0
pkgdesc="Native ANSI C implementations of the Levenberg-Marquardt optimization algorithm"
url="https://users.ics.forth.gr/~lourakis/levmar/"
arch="all"
license="GPL-2.0-or-later"
makedepends="cmake"
depends="lapack-dev blas-dev"
source="levmar-$pkgver.tar.gz::https://users.ics.forth.gr/~lourakis/levmar/levmar-$pkgver.tgz"
builddir="$srcdir/levmar-$pkgver"

build() {
	cmake -B build \
	-DCMAKE_BUILD_TYPE=MinSizeRel \
	-DNEED_F2C:BOOL=false
	cmake --build build
}

check() {
	./build/lmdemo
}

package() {
	install -Dm644 build/liblevmar.a "$pkgdir"/usr/lib/liblevmar.a
	install -Dm644 levmar.h "$pkgdir"/usr/include/levmar.h
}

sha512sums="
5b4c64b63be9b29d6ad2df435af86cd2c2e3216313378561a670ac6a392a51bbf1951e96c6b1afb77c570f23dd8e194017808e46929fec2d8d9a7fe6cf37022b  levmar-2.6.tar.gz
"
